from selenium import webdriver
import time

from selenium.webdriver.common.by import By

driver = webdriver.Chrome()
driver.get('https://www.baidu.com')
time.sleep(5)
kw = driver.find_element(By.ID, 'kw')
kw.send_keys('我的母亲大人')
driver.find_element(By.ID, 'su').click()
time.sleep(2)
js1 = "window.scrollTo(0, document.body.scrollHeight)"
driver.execute_script(js1)


# time.sleep(2)
# js2 = 'window.scrollTo(0, 0)'
# driver.execute_script(js2)
#
# time.sleep(2)
# js3 = "window.scrollTo({left:0, top:document.boby.scrollHeight, behavior:'smooth'})"
# driver.execute_script(js3)
driver.quit()